package com.yc.leetcode;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Scanner;

class D20230305_1 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        String str_0 = scan.nextLine();
        String[] line_list_0 = str_0.trim().split(" ");
        ArrayList<Integer> arr = new ArrayList<>();
        for(int i = 0; i < line_list_0.length; i++){
            arr.add(Integer.parseInt(line_list_0[i]));
        }

        arr.sort(Comparator.reverseOrder());

        scan.close();

        int result = solution(arr);

        System.out.println(result);

    }

    public static int solution(ArrayList<Integer> arr){
        int result = 0;

        for (int m = 0; m < arr.size(); m++) {

            int min = arr.get(m);
            int range = 0;
            for (int i=m; i < arr.size(); i++) {//最高点
                //先找最小值
                if (arr.get(i) < min) {
                    min = arr.get(i);
                } else {
                    range = arr.get(i) - min;
                }
            }
            if (range > result) {
                result = range;
            }

        }


        return result;
    }
}